<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    // class Phone{
    //   constructor(brand,price){
    //     this.brand=brand;
    //     this.price=price;
    //   };
    //   // 方法
    //   call(){
    //     console.log("打电话方法");
    //   }
    // }
    // var huawei=new Phone('华为',1999)
    // console.log(huawei);
    // huawei.call()

    // 类中static修饰的为静态成员，只属于类，不属于实例对象
    class Phone {
      static name = '手机'
      static call() {
        console.log('打电话');
      }
    }
    var nokia = new Phone();
    console.log(nokia.name);
    console.log(Phone.name);
    // console.log(nokia.call());
    console.log(Phone.call());
  </script>
</body>

</html>